The coordinates of the Legionnairess Disease outbreaks will be used to gather weather data from surrounding stations. The averages of the data will be taken and outputted into a graph containing data from the last 10 years before the outbreak.

First I installed and downloaded the packages needed including rnoaa from github.

library(devtools)
install_github("geanders/rnoaa")
library(devtools)
library(rnoaa)
library(riem)
library(countyweather)
library(dplyr)
library(plyr)
library(tidyr)
library(weathermetrics)
library(ggplot2)
library(lubridate)

I created a data frame including the locations of each outbreak. I found the coordinates at http://maps.cga.harvard.edu/gpf/ and crossed checked them with Google coordinates. The other data in this set are year of outbreak and the year 10 years before the outbreak, onset date, and 14 days before the onset date.

id file_id latitude longitude year_min date_min year_max date_max onset before_onset
portugal portugal 38.96 -8.99 2004 2004-01-01 2014 2014-12-31 2004-10-14 2004-09-30
pittsburgh pittsburgh 40.43 -79.98 2002 2002-01-01 2012 2012-12-31 2012-08-26 2012-08-12
quebec quebec 46.85 -71.34 2002 2002-01-01 2012 2012-12-31 2012-07-18 2012-07-04
stoke-on-trent stoke_on_trent 53.02 -2.15 2002 2002-01-01 2012 2012-12-31 2012-07-02 2012-06-18
edinburgh edinburgh 55.94 -3.20 2002 2002-01-01 2012 2012-12-31 2012-05-01 2012-04-17
miyazaki miyazaki 31.89 131.34 1992 1992-01-01 2002 2002-12-31 2002-07-18 2002-07-04
pas-de-calais pas_de_calais 50.51 2.37 1993 1993-01-01 2003 2003-12-31 2003-11-28 2003-11-14
pamplona pamplona 42.81 -1.65 1996 1996-01-01 2006 2006-12-31 2006-06-01 2006-05-18
rapid city rapid_city 44.06 -103.22 1995 1995-01-01 2005 2005-12-31 2005-05-26 2005-05-12
sarpsborg sarpsborg 59.28 11.08 1995 1995-01-01 2005 2005-12-31 2005-05-12 2005-04-28
barrow-in-furness barrow_in_furness 54.10 -3.22 1992 1992-01-01 2002 2002-12-31 2002-07-30 2002-07-16
murcia murcia 37.98 -1.12 1991 1991-01-01 2001 2001-12-31 2001-06-26 2001-06-12
melbourne melbourne -37.86 145.07 1990 1990-01-01 2000 2000-12-31 2000-04-17 2000-04-03
bovenkarspel bovenkarspel 52.70 5.24 1989 1989-01-01 1999 1999-12-31 1999-02-25 1999-02-11
london london 51.52 -0.10 1979 1979-01-01 1989 1989-12-31 1989-01-01 1988-12-18
sydney sydney -33.85 150.93 2006 2006-01-01 2016 2016-12-31 2016-04-25 2016-04-11
genesee1 genesee1 43.09 -83.63 2004 2004-01-01 2014 2014-12-31 2014-06-06 2014-05-23
genesee2 genesee2 43.09 -83.63 2005 2005-01-01 2015 2015-12-31 2015-05-04 2015-04-20
columbus columbus 39.98 -82.99 2003 2003-01-01 2013 2013-12-31 2013-07-09 2013-06-25
bronx bronx 40.82 -73.92 2005 2005-01-01 2015 2015-12-31 2015-07-12 2015-06-28

The next function will download information from all of the stations. It only needs to be downloaded once per session. It will take a couple minutes to download.

I created a loop to get a list of the stations within 30 km of the location.

station_data <- ghcnd_stations()[[1]]
df <- list()
for(i in 1:length(outbreak_loc$id))
  {
    df[[i]] <- (meteo_nearby_stations(lat_lon_df = outbreak_loc[i,],
                                    station_data = station_data,
                                    var = c("PRCP","TAVG","TMAX","TMIN",
                                            "AWND","MDPR"),
                                    year_min = outbreak_loc[i, "year_min"],
                                    year_max = outbreak_loc[i, "year_max"],
                                    radius = 30)[[1]])
  }

names(df) <- outbreak_loc$id
stations <- df
saveRDS(stations, file = "stations.RData")
stations <- readRDS("stations.RData")
stations
## $portugal
## [1] id        name      latitude  longitude distance 
## <0 rows> (or 0-length row.names)
## 
## $pittsburgh
##             id                          name latitude longitude  distance
## 1  US1PAAL0014          PA PITTSBURGH 1.6 SW  40.4226  -79.9974  1.687108
## 2  US1PAAL0017           PA WHITEHALL 1.0 SW  40.3475  -80.0022  9.364279
## 3  USW00014762 PA PITTSBURGH ALLEGHENY CO AP  40.3547  -79.9217  9.720301
## 4  US1PAAL0011        PA WEST MIFFLIN 1.3 SW  40.3466  -79.9283 10.255413
## 5  US1PAAL0031      PA SCOTT TOWNSHIP 1.3 NW  40.3978  -80.0967 10.508788
## 6  USC00360861            PA BRADDOCK LOCK 2  40.3917  -79.8594 11.063215
## 7  US1PAAL0009                 PA PATHFINDER  40.3416  -80.0485 11.414110
## 8  USC00362574      PA EMSWORTH L/D OHIO RVR  40.5019  -80.0833 11.844197
## 9  US1PAAL0016            PA GLENSHAW 1.3 NW  40.5488  -79.9800 13.209957
## 10 USC00365573                 PA MCKEESPORT  40.3392  -79.8603 14.308275
## 11 US1PAAL0008    PA UPPER ST. CLAIR 1.7 WNW  40.3412  -80.1026 14.329100
## 12 US1PAAL0020         PA ALLISON PARK 0.7 W  40.5610  -79.9708 14.587294
## 13 US1PAAL0023 PA SOUTH PARK TOWNSHIP 0.2 NW  40.2989  -79.9970 14.648635
## 14 US1PAAL0003         PA SOUTH FAYETTE 2 SE  40.3381  -80.1159 15.392161
## 15 US1PAAL0001         PA BRIDGEVILLE 1.4 SW  40.3417  -80.1229 15.584945
## 16 US1PAAL0004           PA PENN HILLS 1.5 E  40.4759  -79.7982 16.207171
## 17 USC00360022           PA ACMETONIA LOCK 3  40.5361  -79.8153 18.254228
## 18 US1PAAL0006           PA MCDONALD 2.5 ENE  40.3822  -80.1871 18.323293
## 19 US1PAWS0005            PA MCMURRAY 0.2 NE  40.2831  -80.0857 18.628831
## 20 USW00094823         PA PITTSBURGH INTL AP  40.4847  -80.2144 20.743637
## 21 US1PAAL0030          PA CARNOT-MOON 0.9 S  40.5061  -80.2119 21.364459
## 22 USC00366111           PA MURRYSVILLE 2 SW  40.4119  -79.7244 21.730660
## 23 US1PAWT0001        PA NORTH IRWIN 2.5 WSW  40.3243  -79.7556 22.348628
## 24 USC00365918              PA MOON TOWNSHIP  40.5319  -80.2172 23.040372
## 25 USC00363343      PA GLENWILLARD DASHIELDS  40.5514  -80.2167 24.143027
## 26 US1PAWT0010        PA MURRYSVILLE 1.5 WSW  40.4317  -79.6813 25.282776
## 27 US1PAAL0012        PA SOUTH HEIGHTS 1.5 S  40.5533  -80.2379 25.760534
## 
## $quebec
##            id                         name latitude longitude  distance
## 1 CA007011309  QC CHARLESBOURG PARC ORLEAN  46.8667  -71.2667  5.874619
## 2 CA007016294 QC QUEBEC/JEAN LESAGE INTL A  46.8000  -71.3833  6.462488
## 3 CA00701S001   QC QUEBEC/JEAN LESAGE INTL  46.8000  -71.3833  6.462488
## 4 CA00701Q004        QC STE-FOY (U. LAVAL)  46.7833  -71.2833  8.580380
## 5 CA007010565                  QC BEAUPORT  46.8333  -71.2000 10.808994
## 6 CA007018572                QC VALCARTIER  46.9000  -71.5000 13.372471
## 7 CA007024254                    QC LAUZON  46.8167  -71.1000 18.628731
## 8 CA007020567                QC BEAUSEJOUR  46.6667  -71.1667 24.283856
## 9 CA007041330            QC CHATEAU RICHER  46.9667  -71.0333 26.668362
## 
## $`stoke-on-trent`
## [1] id        name      latitude  longitude distance 
## <0 rows> (or 0-length row.names)
## 
## $edinburgh
## [1] id        name      latitude  longitude distance 
## <0 rows> (or 0-length row.names)
## 
## $miyazaki
##            id       name latitude longitude  distance
## 1 JA000047830   MIYAZAKI   31.933   131.417  8.699733
## 2 JA000047829 MIYAKONOJO   31.733   131.083 29.908209
## 
## $`pas-de-calais`
## [1] id        name      latitude  longitude distance 
## <0 rows> (or 0-length row.names)
## 
## $pamplona
##            id                    name latitude longitude distance
## 1 SPE00120350 PAMPLONA (OBSERVATORIO)  42.8175   -1.6364 1.387848
## 2 SPE00120359                PAMPLONA  42.7767   -1.6500 3.702791
## 
## $`rapid city`
##             id                         name latitude longitude  distance
## 1  USC00396948            SD RAPID CITY WFO  44.0728 -103.2108  1.601898
## 2  USC00396947            SD RAPID CITY 4NW  44.1150 -103.2828  7.909484
## 3  USW00024090        SD RAPID CITY RGNL AP  44.0433 -103.0536 13.427258
## 4  USC00394343            SD JOHNSON SIDING  44.0839 -103.4342 17.317536
## 5  USR0000SBAK   SD BAKER PARK SOUTH DAKOTA  43.9792 -103.4250 18.692682
## 6  USC00396427               SD PACTOLA DAM  44.0622 -103.4819 20.928415
## 7  USC00394556                  SD KEYSTONE  43.9039 -103.4100 23.073539
## 8  USR0000SNEM         SD NEMO SOUTH DAKOTA  44.1917 -103.5097 27.370234
## 9  USC00395870      SD MT RUSHMORE NATL MEM  43.8769 -103.4578 27.869317
## 10 USR0000SMRU SD MT. RUSHMORE SOUTH DAKOTA  43.8750 -103.4583 28.051427
## 11 USC00393775             SD HERMOSA 3 SSW  43.8069 -103.2131 28.148859
## 
## $sarpsborg
##            id              name latitude longitude  distance
## 1 NOE00109849         SARPSBORG  59.2856   11.1144  2.050694
## 2 NOE00134298            FLOTER  59.4964   11.0131 24.358920
## 3 NOE00100575            HALDEN  59.1225   11.3883 24.795447
## 4 NOE00109786            HVALER  59.0358   11.0517 27.201683
## 5 NOE00109876 MOSS BRANNSTASJON  59.4428   10.6842 28.822789
## 6 NOE00109867              MOSS  59.4339   10.6667 29.008867
## 
## $`barrow-in-furness`
## [1] id        name      latitude  longitude distance 
## <0 rows> (or 0-length row.names)
## 
## $murcia
##            id                name latitude longitude distance
## 1 SPE00120323              MURCIA  38.0028   -1.1692 5.001690
## 2 SPE00120332 MURCIA/ALCANTARILLA  37.9578   -1.2294 9.902609
## 
## $melbourne
##             id                           name latitude longitude  distance
## 1  ASN00086018         CAULFIELD (RACECOURSE) -37.8795  145.0368  3.632396
## 2  ASN00086304      HAWTHORN (SCOTCH COLLEGE) -37.8361  145.0294  4.446429
## 3  ASN00086095           PRAHRAN (COMO HOUSE) -37.8376  145.0048  6.243145
## 4  ASN00086088 OAKLEIGH (METROPOLITAN GOLF CL -37.9142  145.0935  6.369850
## 5  ASN00086012     BOX HILL AGED MENS RETREAT -37.8364  145.1364  6.393542
## 6  ASN00086006                      BENTLEIGH -37.9279  145.0749  7.562369
## 7  ASN00086033 BRIGHTON (DENDY PARK BOWLING C -37.9252  145.0254  8.238821
## 8  ASN00086232    MELBOURNE BOTANICAL GARDENS -37.8303  144.9767  8.833034
## 9  ASN00086279                      NORTHCOTE -37.7797  145.0314  9.551015
## 10 ASN00086316     VERMONT TRANSPORT RESEARCH -37.8587  145.1847 10.070617
## 11 ASN00086071      MELBOURNE REGIONAL OFFICE -37.8075  144.9700 10.545355
## 12 ASN00086020     CHELTENHAM KINGSTON CENTRE -37.9551  145.0782 10.599081
## 13 ASN00086303    GLEN WAVERLEY (GOLF COURSE) -37.8886  145.1928 11.237859
## 14 ASN00086074                        MITCHAM -37.8219  145.1906 11.406147
## 15 ASN00086260                HEIDELBERG MMBW -37.7567  145.0533 11.579751
## 16 ASN00086378                      BRUNSWICK -37.7667  144.9797 13.059611
## 17 ASN00086111          SPRINGVALE NECROPOLIS -37.9445  145.1764 13.245203
## 18 ASN00086369           SPRINGVALE (SANDOWN) -37.9535  145.1655 13.352636
## 19 ASN00086068             VIEWBANK (ARPANSA) -37.7408  145.0972 13.468157
## 20 ASN00086077              MOORABBIN AIRPORT -37.9800  145.0964 13.542852
## 21 ASN00086146                      BEAUMARIS -37.9771  145.0273 13.548961
## 22 ASN00086362   DONCASTER (MANNINGHAM DEPOT) -37.7494  145.1703 15.129262
## 23 ASN00086351  BUNDOORA (LATROBE UNIVERSITY) -37.7163  145.0453 16.125457
## 24 ASN00086039          FLEMINGTON RACECOURSE -37.7915  144.9067 16.239778
## 25 ASN00086104    SCORESBY RESEARCH INSTITUTE -37.8710  145.2561 16.382188
## 26 ASN00086096              PRESTON RESERVOIR -37.7214  145.0059 16.408663
## 27 ASN00086230                      BAYSWATER -37.8372  145.2558 16.509685
## 28 ASN00086379                 RINGWOOD NORTH -37.7917  145.2433 17.010511
## 29 ASN00086101                       RINGWOOD -37.8000  145.2500 17.158761
## 30 ASN00086313                     WARRANDYTE -37.7469  145.2098 17.578887
## 31 ASN00086347       YARRA RIVER @ WARRANDYTE -37.7417  145.2167 18.416453
## 32 ASN00086224                      DANDENONG -37.9785  145.2235 18.839479
## 33 ASN00086035                         ELTHAM -37.7011  145.1547 19.172878
## 34 ASN00087038 MARIBYRNONG EXPLOSIVES FACTORY -37.7750  144.8767 19.432886
## 35 ASN00086324       FERNTREE GULLY (PROBERT) -37.8797  145.2964 19.993316
## 36 ASN00086027        CROYDON (SAMUEL STREET) -37.7903  145.2812 20.103933
## 37 ASN00086234        CROYDON (COUNCIL DEPOT) -37.7869  145.2847 20.535018
## 38 ASN00086038               ESSENDON AIRPORT -37.7276  144.9066 20.564229
## 39 ASN00087131          ALTONA (CITY OFFICES) -37.8633  144.8261 21.414594
## 40 ASN00087148    SUNSHINE (CITY OF BRINBANK) -37.7928  144.8344 22.000521
## 41 ASN00086250                         PLENTY -37.6600  145.1244 22.747356
## 42 ASN00086256                    FERNY CREEK -37.8833  145.3333 23.256162
## 43 ASN00086210              BONBEACH (CARRUM) -38.0651  145.1294 23.393049
## 44 ASN00086372       FERNY CREEK (DUNNS HILL) -37.8775  145.3364 23.465245
## 45 ASN00086365                    MOOROOLBARK -37.7792  145.3197 23.701976
## 46 ASN00086251            UPWEY SHIRE COUNCIL -37.9144  145.3317 23.749365
## 47 ASN00086243           MOUNT DANDENONG GTV9 -37.8306  145.3500 24.802430
## 48 ASN00086059                KANGAROO GROUND -37.6830  145.2518 25.351527
## 49 ASN00086254       CARRUM DOWNS SEWER WORKS -38.0783  145.1733 25.907856
## 50 ASN00086036                         EPPING -37.6312  144.9846 26.526359
## 51 ASN00086066                       LILYDALE -37.7488  145.3416 26.875070
## 52 ASN00086076                       MONTROSE -37.8019  145.3675 26.914609
## 53 ASN00086085 NARRE WARREN NORTH (NARRE WARR -37.9897  145.3356 27.399212
## 54 ASN00087031                  LAVERTON RAAF -37.8565  144.7566 27.516720
## 55 ASN00087027               KEILOR (ARUNDEL) -37.6942  144.8342 27.737658
## 56 ASN00087177            LAVERTON COMPARISON -37.8633  144.7456 28.480727
## 57 ASN00086305            GREENVALE RESERVOIR -37.6369  144.9072 28.640881
## 58 ASN00086384   MELBOURNE AIRPORT COMPARISON -37.6750  144.8419 28.725743
## 59 ASN00087015                         KEILOR -37.7025  144.8072 28.984935
## 
## $bovenkarspel
##             id          name latitude longitude  distance
## 1  NLE00101917     ENKHUIZEN  52.6917    5.2944  3.780363
## 2  NLE00109144   HOOGKARSPEL  52.6867    5.1669  5.143626
## 3  NLE00101928     MEDEMBLIK  52.7781    5.1014 12.746887
## 4  NLE00100501         HOORN  52.6444    5.0681 13.136277
## 5  NLE00102479      BERKHOUT  52.6428    4.9789 18.718869
## 6  NLE00109146      HOOGWOUD  52.7281    4.9608 19.065006
## 7  NLE00109174   KREILEROORD  52.8619    5.0953 20.464698
## 8  NLE00102134      STAVOREN  52.8967    5.3831 23.894441
## 9  NLE00109232         OBDAM  52.6775    4.8769 24.600539
## 10 NLE00109054          EDAM  52.5114    5.0467 24.701897
## 11 NLE00109250    OUDEMIRDUM  52.8608    5.5078 25.379621
## 12 NLE00109162       KOLHORN  52.7914    4.8919 25.540549
## 13 NLE00109354 WEST BEEMSTER  52.5817    4.9028 26.281190
## 14 NLE00101948     TOLLEBEEK  52.6719    5.6300 26.472774
## 15 NLE00101930     DEN OEVER  52.9217    5.0383 28.133541
## 16 NLE00101932        MARKEN  52.4600    5.1078 28.142012
## 17 NLE00109028     DE HAUKES  52.8783    4.9408 28.246661
## 18 NLE00109254     PURMEREND  52.5125    4.9506 28.575998
## 
## $london
##            id     name latitude longitude distance
## 1 UKM00003772 HEATHROW   51.478    -0.461 25.42177
## 
## $sydney
##             id                           name latitude longitude  distance
## 1  ASN00067019             PROSPECT RESERVOIR -33.8193  150.9127  3.769152
## 2  ASN00067017   GREYSTANES (BATHURST STREET) -33.8136  150.9392  4.135739
## 3  ASN00067070   MERRYLANDS (WELSFORD STREET) -33.8269  150.9767  5.020100
## 4  ASN00067114 ABBOTSBURY (FAIRFIELD CITY FAR -33.8667  150.8611  6.627566
## 5  ASN00067119 HORSLEY PARK EQUESTRIAN CENTRE -33.8511  150.8567  6.770114
## 6  ASN00067110  SEVEN HILLS  (RADIO FM 103.2) -33.7858  150.9236  7.163157
## 7  ASN00067026       SEVEN HILLS (COLLINS ST) -33.7704  150.9318  8.852678
## 8  ASN00067020 LIVERPOOL (MICHAEL WENDEN CENT -33.9214  150.8861  8.913714
## 9  ASN00066137          BANKSTOWN AIRPORT AWS -33.9181  150.9864  9.189477
## 10 ASN00066134       GRANVILLE SHELL REFINERY -33.8322  151.0340  9.806921
## 11 ASN00066168 MILPERRA BRIDGE (GEORGES RIVER -33.9289  150.9831 10.049571
## 12 ASN00067042    KINGS LANGLEY (SOLANDER RD) -33.7610  150.9498 10.064021
## 13 ASN00067111 NORTH PARRAMATTA (BURNSIDE HOM -33.7931  151.0167 10.206744
## 14 ASN00067109   BAULKHAM HILLS EUCALYPTUS CT -33.7678  150.9814 10.300292
## 15 ASN00066124 PARRAMATTA NORTH (MASONS DRIVE -33.7917  151.0181 10.404864
## 16 ASN00066050           POTTS HILL RESERVOIR -33.8933  151.0346 10.790772
## 17 ASN00066164       ROOKWOOD (HAWTHORNE AVE) -33.8771  151.0577 12.169844
## 18 ASN00067112 NORTH ROCKS (MUIRFIELD GOLF CL -33.7672  151.0186 12.319787
## 19 ASN00066195 SYDNEY OLYMPIC PARK (SYDNEY OL -33.8521  151.0646 12.431978
## 20 ASN00066070          STRATHFIELD GOLF CLUB -33.8805  151.0631 12.748603
## 21 ASN00066054         REVESBY (PATEN STREET) -33.9474  151.0065 12.928587
## 22 ASN00067076   QUAKERS HILL TREATMENT WORKS -33.7366  150.8758 13.567795
## 23 ASN00066185      CARLINGFORD (BARELLAN AV) -33.7801  151.0587 14.205035
## 24 ASN00066191        GLENFIELD (HARROW ROAD) -33.9770  150.9042 14.321038
## 25 ASN00067117       HOLSWORTHY CONTROL RANGE -33.9795  150.9254 14.405998
## 26 ASN00067102          ST CLAIR (JUBA CLOSE) -33.8044  150.7778 14.945410
## 27 ASN00067100     CASTLE HILL (KATHLEEN AVE) -33.7260  150.9944 15.017779
## 28 ASN00067089 WEST PENNANT HILLS (CUMBERLAND -33.7459  151.0402 15.416884
## 29 ASN00067003         COLYTON (CARPENTER ST) -33.7770  150.7877 15.450666
## 30 ASN00067098 WEST PENNANT HILLS  (ORATAVA A -33.7487  151.0449 15.478987
## 31 ASN00066013              CONCORD GOLF CLUB -33.8523  151.0985 15.562401
## 32 ASN00067061         ROSSMORE (SOUTH CREEK) -33.9353  150.7819 16.638119
## 33 ASN00066048             CONCORD (BRAYS RD) -33.8483  151.1105 16.669913
## 34 ASN00067037         SCHOFIELDS BOUNDARY RD -33.6947  150.8868 17.724215
## 35 ASN00066194      CANTERBURY RACECOURSE AWS -33.9057  151.1134 18.028240
## 36 ASN00066148            PEAKHURST GOLF CLUB -33.9700  151.0638 18.179759
## 37 ASN00066034 ABBOTSFORD (BLACKWALL POINT RD -33.8507  151.1295 18.423361
## 38 ASN00067116       WILLMOT (RESOLUTION AVE) -33.7231  150.7997 18.550317
## 39 ASN00066156 MACQUARIE PARK (WILLANDRA VILL -33.7791  151.1121 18.579019
## 40 ASN00066047   PENNANT HILLS (YARRARA ROAD) -33.7324  151.0767 18.835558
## 41 ASN00066190   INGLEBURN (SACKVILLE STREET) -34.0117  150.8647 18.962689
## 42 ASN00067108             BADGERYS CREEK AWS -33.8969  150.7281 19.355573
## 43 ASN00066181       OATLEY (WORONORA PARADE) -33.9766  151.0766 19.523783
## 44 ASN00066004            BEXLEY BOWLING CLUB -33.9430  151.1098 19.553323
## 45 ASN00067086      DURAL (OLD NORTHERN ROAD) -33.6867  151.0250 20.170027
## 46 ASN00066036         MARRICKVILLE GOLF CLUB -33.9186  151.1402 20.849104
## 47 ASN00066131          RIVERVIEW OBSERVATORY -33.8258  151.1556 21.009524
## 48 ASN00067104          BOX HILL (HYNDS ROAD) -33.6617  150.9000 21.120894
## 49 ASN00066189       WEST PYMBLE (WYUNA ROAD) -33.7693  151.1380 21.209116
## 50 ASN00067084  ORCHARD HILLS TREATMENT WORKS -33.8020  150.7069 21.288391
## 51 ASN00066204  OYSTER BAY (GREEN POINT ROAD) -34.0009  151.0738 21.391107
## 52 ASN00066158 TURRAMURRA (KISSING POINT ROAD -33.7366  151.1271 22.152621
## 53 ASN00066120               GORDON GOLF CLUB -33.7617  151.1462 22.258367
## 54 ASN00066078          LUCAS HEIGHTS (ANSTO) -34.0517  150.9800 22.897282
## 55 ASN00067015           BRINGELLY (MARYLAND) -33.9696  150.7250 23.124628
## 56 ASN00068160 CAMPBELLTOWN (KENTLYN (GEORGES -34.0542  150.8772 23.222412
## 57 ASN00068250      CAMDEN VALLEY GOLF RESORT -34.0128  150.7675 23.504569
## 58 ASN00066157      PYMBLE (CANISIUS COLLEGE) -33.7371  151.1521 24.058869
## 59 ASN00066058     SANS SOUCI (PUBLIC SCHOOL) -33.9942  151.1292 24.391064
## 60 ASN00067022      GALSTON (ROWLAND VILLAGE) -33.6550  151.0553 24.583503
## 61 ASN00068231          RUSE (DENISON STREET) -34.0630  150.8489 24.837610
## 62 ASN00066114   NORTH TURRAMURRA (DRYDEN RD) -33.7179  151.1470 24.858762
## 63 ASN00066037             SYDNEY AIRPORT AMO -33.9465  151.1731 24.870760
## 64 ASN00066062      SYDNEY (OBSERVATORY HILL) -33.8607  151.2050 25.421751
## 65 ASN00066011         CHATSWOOD BOWLING CLUB -33.8000  151.2000 25.553205
## 66 ASN00067115 GLENMORE PARK  (CARTWRIGHT CL) -33.7826  150.6619 25.877100
## 67 ASN00066006         SYDNEY BOTANIC GARDENS -33.8662  151.2160 26.470162
## 68 ASN00066080   CASTLE COVE (ROSEBRIDGE AVE) -33.7809  151.2044 26.489163
## 69 ASN00066176  AUDLEY  (ROYAL NATIONAL PARK) -34.0658  151.0567 26.689966
## 70 ASN00067029           WALLACIA POST OFFICE -33.8637  150.6410 26.729649
## 71 ASN00066206      ST IVES (RICHMOND AVENUE) -33.7096  151.1730 27.351861
## 72 ASN00067113              PENRITH LAKES AWS -33.7195  150.6783 27.416523
## 73 ASN00068257     CAMPBELLTOWN (MOUNT ANNAN) -34.0615  150.7735 27.594122
## 74 ASN00066073            RANDWICK RACECOURSE -33.9105  151.2276 28.284461
## 75 ASN00068254     MOUNT ANNAN BOTANIC GARDEN -34.0673  150.7678 28.418732
## 76 ASN00066160                CENTENNIAL PARK -33.8959  151.2341 28.535385
## 77 ASN00067031           WINDSOR BOWLING CLUB -33.6100  150.8151 28.724326
## 78 ASN00066188         BELROSE (EVELYN PLACE) -33.7402  151.2173 29.221247
## 79 ASN00066052          RANDWICK BOWLING CLUB -33.9096  151.2419 29.545881
## 80 ASN00066086                   CRONULLA STP -34.0313  151.1642 29.549535
## 81 ASN00067010     GLENORIE (OLD NORTHERN RD) -33.5908  151.0094 29.742533
## 
## $genesee1
##             id                    name latitude longitude  distance
## 1  USC00201150            MI BURTON 4N  43.0675  -83.5919  3.979309
## 2  US1MIGN0010       MI BURTON 0.9 NNW  43.0085  -83.6274  9.064849
## 3  US1MIGN0008 MI MOUNT MORRIS 3.1 WSW  43.1057  -83.7580 10.538333
## 4  US1MIGN0014       MI DAVISON 3.3 SW  43.0003  -83.5684 11.159857
## 5  US1MIGN0005      MI DAVISON 0.7 SSW  43.0219  -83.5246 11.431375
## 6  USC00202851            MI FLINT 7 W  43.0378  -83.7694 12.725462
## 7  USC00201645                 MI CLIO  43.1794  -83.7369 13.193328
## 8  US1MIGN0009        MI BURTON 3.3 SW  42.9613  -83.6636 14.569099
## 9  USW00014826 MI FLINT BISHOP INTL AP  42.9667  -83.7494 16.797891
## 10 US1MIGN0023  MI GRAND BLANC 3.8 WNW  42.9440  -83.6886 16.919078
## 11 US1MISG0004    MI BIRCH RUN 2.6 ESE  43.2291  -83.7470 18.146491
## 12 US1MIGN0020 MI SWARTZ CREEK 2.0 NNE  42.9897  -83.8166 18.824526
## 13 US1MIGN0015        MI FLINT 6.4 SSW  42.9326  -83.7210 19.001794
## 14 US1MIGN0018   MI GRAND BLANC 0.7 SE  42.9187  -83.6079 19.132279
## 15 USC00203278             MI GOODRICH  42.9164  -83.5097 21.640755
## 16 USC00204659            MI LAPEER 2W  43.0581  -83.3606 22.167570
## 17 US1MIGN0022   MI GRAND BLANC 2.9 SE  42.8909  -83.5858 22.428899
## 18 US1MIGN0004      MI MONTROSE 0.4 NW  43.1794  -83.8987 23.962697
## 19 USC00205488      MI MILLINGTON 3 SE  43.2836  -83.4792 24.756898
## 20 US1MILP0003       MI LAPEER 1.1 SSW  43.0316  -83.3293 25.277892
## 21 USC00204655          MI LAPEER WWTP  43.0608  -83.3075 26.394851
## 22 USC00202955      MI FRANKENMUTH 1SE  43.3194  -83.7161 26.445482
## 
## $genesee2
##             id                    name latitude longitude  distance
## 1  USC00201150            MI BURTON 4N  43.0675  -83.5919  3.979309
## 2  US1MIGN0010       MI BURTON 0.9 NNW  43.0085  -83.6274  9.064849
## 3  US1MIGN0008 MI MOUNT MORRIS 3.1 WSW  43.1057  -83.7580 10.538333
## 4  US1MIGN0014       MI DAVISON 3.3 SW  43.0003  -83.5684 11.159857
## 5  US1MIGN0005      MI DAVISON 0.7 SSW  43.0219  -83.5246 11.431375
## 6  USC00202851            MI FLINT 7 W  43.0378  -83.7694 12.725462
## 7  US1MIGN0024          MI CLIO 0.4 SW  43.1725  -83.7423 12.930649
## 8  USC00201645                 MI CLIO  43.1794  -83.7369 13.193328
## 9  US1MIGN0009        MI BURTON 3.3 SW  42.9613  -83.6636 14.569099
## 10 USW00014826 MI FLINT BISHOP INTL AP  42.9667  -83.7494 16.797891
## 11 US1MIGN0023  MI GRAND BLANC 3.8 WNW  42.9440  -83.6886 16.919078
## 12 US1MISG0004    MI BIRCH RUN 2.6 ESE  43.2291  -83.7470 18.146491
## 13 US1MIGN0020 MI SWARTZ CREEK 2.0 NNE  42.9897  -83.8166 18.824526
## 14 US1MIGN0015        MI FLINT 6.4 SSW  42.9326  -83.7210 19.001794
## 15 US1MIGN0018   MI GRAND BLANC 0.7 SE  42.9187  -83.6079 19.132279
## 16 USC00203278             MI GOODRICH  42.9164  -83.5097 21.640755
## 17 USC00204659            MI LAPEER 2W  43.0581  -83.3606 22.167570
## 18 US1MIGN0022   MI GRAND BLANC 2.9 SE  42.8909  -83.5858 22.428899
## 19 US1MIGN0004      MI MONTROSE 0.4 NW  43.1794  -83.8987 23.962697
## 20 USC00205488      MI MILLINGTON 3 SE  43.2836  -83.4792 24.756898
## 21 US1MILP0003       MI LAPEER 1.1 SSW  43.0316  -83.3293 25.277892
## 22 USC00204655          MI LAPEER WWTP  43.0608  -83.3075 26.394851
## 23 USC00202955      MI FRANKENMUTH 1SE  43.3194  -83.7161 26.445482
## 
## $columbus
##             id                              name latitude longitude
## 1  US1OHFR0018               OH COLUMBUS 2.4 WNW  39.9977  -83.0323
## 2  US1OHFR0025               OH COLUMBUS 2.8 WSW  39.9804  -83.0397
## 3  US1OHFR0003        OH GRANDVIEW HEIGHTS 0.1 N  39.9810  -83.0401
## 4  USC00331785                  OH COLUMBUS WCMH  40.0250  -83.0269
## 5  US1OHFR0034                OH COLUMBUS 3.6 NW  40.0191  -83.0437
## 6  US1OHFR0020                OH COLUMBUS 3.5 NE  40.0287  -82.9477
## 7  US1OHFR0001          OH UPPER ARLINGTON 0.9 E  40.0279  -83.0543
## 8  US1OHFR0021           OH MARBLE CLIFF 1.1 WNW  39.9931  -83.0786
## 9  US1OHFR0007        OH UPPER ARLINGTON 1.3 SSW  40.0112  -83.0832
## 10 USW00014821 OH COLUMBUS PORT COLUMBUS INTL AP  39.9914  -82.8808
## 11 USC00331783       OH COLUMBUS-VALLEY CROSSING  39.9047  -82.9200
## 12 US1OHFR0012        OH UPPER ARLINGTON 2.4 NNW  40.0604  -83.0815
## 13 USC00331777        OH COLUMBUS-HAP CREMEAN WP  40.0603  -82.8942
## 14 US1OHFR0024               OH COLUMBUS 9.3 NNE  40.0925  -82.9582
## 15 USW00004804    OH COLUMBUS OHIO STATE UNIV AP  40.0781  -83.0781
## 16 US1OHFR0037             OH REYNOLDSBURG 1.6 W  39.9588  -82.8294
## 17 US1OHFR0016                 OH DUBLIN 3.7 ESE  40.0923  -83.0725
## 18 US1OHFR0022                 OH GALLOWAY 3.1 N  39.9561  -83.1592
## 19 USC00331779          OH COLUMBUS-PARSONS AVE.  39.8469  -82.9872
## 20 USC00338951                    OH WESTERVILLE  40.1264  -82.9433
## 21 US1OHFR0010            OH WESTERVILLE 0.2 WNW  40.1226  -82.9213
## 22 US1OHFR0030                 OH HILLIARD 1.8 W  40.0344  -83.1768
## 23 US1OHFR0008             OH NEW ALBANY 2.8 SSE  40.0403  -82.7980
## 24 US1OHFR0002                 OH DUBLIN 3.2 ENE  40.1299  -83.0742
## 25 US1OHLC0002              OH PATASKALA 4.4 WNW  40.0273  -82.7490
## 26 US1OHFF0005           OH PICKERINGTON 2.7 NNE  39.9263  -82.7469
## 27 US1OHDL0002              OH WESTERVILLE 4.0 N  40.1790  -82.9256
## 28 US1OHFR0023             OH HARRISBURG 3.7 WNW  39.8378  -83.2321
## 29 US1OHLC0011               OH PATASKALA 2.0 NE  40.0240  -82.6511
##     distance
## 1   4.106137
## 2   4.234920
## 3   4.270197
## 4   5.909011
## 5   6.310790
## 6   6.504242
## 7   7.639623
## 8   7.687720
## 9   8.664212
## 10  9.389591
## 11 10.282003
## 12 11.858973
## 13 12.094496
## 14 12.799033
## 15 13.238469
## 16 13.887609
## 17 14.326951
## 18 14.662096
## 19 14.801971
## 20 16.757176
## 21 16.900247
## 22 17.021110
## 23 17.673463
## 24 18.143413
## 25 21.190424
## 26 21.564691
## 27 22.796070
## 28 26.008132
## 29 29.278406
## 
## $bronx
##             id                        name latitude longitude  distance
## 1  USW00014732    NY NEW YORK LAGUARDIA AP  40.7794  -73.8803  5.616756
## 2  USW00094728    NY NEW YORK CNTRL PK TWR  40.7789  -73.9692  6.167420
## 3  USC00300961                    NY BRONX  40.8369  -73.8494  6.230297
## 4  US1NJBG0018   NJ PALISADES PARK 0.2 WNW  40.8481  -74.0002  7.435652
## 5  US1NJBG0003            NJ TENAFLY 1.3 W  40.9147  -73.9775 11.587163
## 6  US1NYQN0002    NY MIDDLE VILLAGE 0.5 SW  40.7145  -73.8819 12.161951
## 7  USW00094741             NJ TETERBORO AP  40.8500  -74.0614 12.354793
## 8  US1NJBG0001       NJ BERGENFIELD 0.3 SW  40.9213  -74.0020 13.206762
## 9  US1NJBG0012        NJ WOOD RIDGE 0.6 SE  40.8420  -74.0830 13.930427
## 10 US1NJBG0033       NJ WOOD RIDGE 0.6 NNW  40.8536  -74.0943 15.131881
## 11 US1NYWC0009       NY NEW ROCHELLE 1.3 S  40.9040  -73.7770 15.226895
## 12 US1NJBG0013         NJ RUTHERFORD 1.2 N  40.8373  -74.1065 15.809146
## 13 US1NYKN0025          NY BROOKLYN 3.1 NW  40.6846  -73.9867 16.069963
## 14 US1NJBG0031         NJ DEMAREST 0.6 NNW  40.9628  -73.9600 16.230719
## 15 US1NJBG0002   NJ SADDLE BROOK TWP 0.6 E  40.9027  -74.0834 16.534408
## 16 US1NJBG0011   NJ NORTH ARLINGTON 0.7 NE  40.7944  -74.1190 16.988985
## 17 US1NJBG0008 NJ SADDLE BROOK TWP 0.3 NNE  40.9071  -74.0934 17.505118
## 18 USC00286146              NJ NEW MILFORD  40.9611  -74.0158 17.635536
## 19 US1NJBG0015  NJ NORTH ARLINGTON 0.7 WNW  40.7915  -74.1398 18.769309
## 20 US1NJHD0002            NJ KEARNY 1.7 NW  40.7729  -74.1409 19.318492
## 21 US1NJBG0005         NJ WESTWOOD 0.8 ESE  40.9830  -74.0159 19.836072
## 22 US1NJBG0010     NJ RIVER VALE TWP 1.5 S  40.9915  -74.0123 20.587159
## 23 US1NYNS0007        NY FLORAL PARK 0.4 W  40.7230  -73.7110 20.642010
## 24 US1NJHD0001           NJ HARRISON 0.3 N  40.7480  -74.1518 21.094543
## 25 USC00283704                 NJ HARRISON  40.7514  -74.1567 21.338273
## 26 US1NJBG0020          NJ PARAMUS 1.8 NNW  40.9682  -74.0902 21.822558
## 27 USC00302129      NY DOBBS FERRY-ARDSLEY  41.0072  -73.8344 22.023427
## 28 US1NJBG0017        NJ GLEN ROCK 0.7 SSE  40.9511  -74.1183 22.145027
## 29 US1NJES0020         NJ BLOOMFIELD 1.7 S  40.7850  -74.1885 22.932509
## 30 US1NYKN0003          NY BROOKLYN 2.4 SW  40.6194  -73.9859 22.986706
## 31 US1NYWC0005         NY HARRISON 4.1 SSW  40.9639  -73.7232 23.014851
## 32 USC00307587                NY SEA CLIFF  40.8506  -73.6483 23.109762
## 33 US1NJBG0037        NJ GLEN ROCK 0.4 WNW  40.9614  -74.1328 23.815579
## 34 US1NJPS0014        NJ HAWTHORNE 1.0 SSE  40.9436  -74.1523 23.880745
## 35 USC00289832           NJ WOODCLIFF LAKE  41.0139  -74.0425 23.891667
## 36 US1NJES0015        NJ MONTCLAIR 2.2 NNE  40.8565  -74.2004 23.935385
## 37 USW00094789     NY NEW YORK JFK INTL AP  40.6386  -73.7622 24.159135
## 38 US1NJPS0017     NJ WOODLAND PARK 0.1 NW  40.8918  -74.1960 24.547061
## 39 US1NJPS0005          NJ HAWTHORNE 0.4 S  40.9519  -74.1577 24.787058
## 40 US1NJES0011   NJ CEDAR GROVE TWP 0.9 NE  40.8648  -74.2157 25.368252
## 41 USC00305796        NY NY AVE V BROOKLYN  40.5939  -73.9808 25.658206
## 42 US1NJPS0018           NJ PATERSON 2.0 W  40.9163  -74.2005 25.903423
## 43 USW00014734           NJ NEWARK INTL AP  40.6825  -74.1694 25.982975
## 44 US1NJPS0003 NJ LITTLE FALLS TWP 0.2 NNW  40.8788  -74.2205 26.107408
## 45 US1NJPS0012 NJ LITTLE FALLS TWP 0.5 WNW  40.8796  -74.2270 26.658883
## 46 USC00284887             NJ LITTLE FALLS  40.8858  -74.2261 26.764590
## 47 US1NJES0024    NJ CEDAR GROVE TWP 0.4 W  40.8557  -74.2356 26.845270
## 48 US1NYNS0014          NY LYNBROOK 0.3 NW  40.6623  -73.6780 26.891776
## 49 USC00285503             NJ MIDLAND PARK  40.9939  -74.1453 27.062890
## 50 USC00305377                  NY MINEOLA  40.7328  -73.6183 27.191818
## 51 US1NJPS0004      NJ NORTH HALEDON 0.6 N  40.9713  -74.1856 27.953822
## 52 US1NJES0010        NJ VERONA TWP 0.7 SW  40.8255  -74.2531 28.035405
## 53 US1NJES0021       NJ VERONA TWP 0.6 WSW  40.8305  -74.2539 28.119240
## 54 US1NJES0004   NJ NORTH CALDWELL 0.6 SSE  40.8576  -74.2523 28.265572
## 55 US1NJPS0008        NJ WAYNE TWP 1.1 ESE  40.9412  -74.2267 29.094312
## 56 US1NYWC0003     NY WHITE PLAINS 3.1 NNW  41.0639  -73.7722 29.826697
## 57 US1NYNS0009         NY MILL NECK 1.1 SW  40.8704  -73.5717 29.828998
## 58 US1NYRL0005       NY WEST NYACK 1.3 WSW  41.0835  -73.9930 29.934369

Not all the locations have stations nearby. Therefore, I will omit them from the weather data evaluation using the following code.

has_stations <- sapply(stations, function(x) nrow(x) > 0)
outbreak_loc_true <- outbreak_loc %>%  filter(has_stations)
outbreak_loc_true
##              id      file_id latitude longitude year_min   date_min
## 1    pittsburgh   pittsburgh    40.43    -79.98     2002 2002-01-01
## 2        quebec       quebec    46.85    -71.34     2002 2002-01-01
## 3      miyazaki     miyazaki    31.89    131.34     1992 1992-01-01
## 4      pamplona     pamplona    42.81     -1.65     1996 1996-01-01
## 5    rapid city   rapid_city    44.06   -103.22     1995 1995-01-01
## 6     sarpsborg    sarpsborg    59.28     11.08     1995 1995-01-01
## 7        murcia       murcia    37.98     -1.12     1991 1991-01-01
## 8     melbourne    melbourne   -37.86    145.07     1990 1990-01-01
## 9  bovenkarspel bovenkarspel    52.70      5.24     1989 1989-01-01
## 10       london       london    51.52     -0.10     1979 1979-01-01
## 11       sydney       sydney   -33.85    150.93     2006 2006-01-01
## 12     genesee1     genesee1    43.09    -83.63     2004 2004-01-01
## 13     genesee2     genesee2    43.09    -83.63     2005 2005-01-01
## 14     columbus     columbus    39.98    -82.99     2003 2003-01-01
## 15        bronx        bronx    40.82    -73.92     2005 2005-01-01
##    year_max   date_max      onset before_onset
## 1      2012 2012-12-31 2012-08-26   2012-08-12
## 2      2012 2012-12-31 2012-07-18   2012-07-04
## 3      2002 2002-12-31 2002-07-18   2002-07-04
## 4      2006 2006-12-31 2006-06-01   2006-05-18
## 5      2005 2005-12-31 2005-05-26   2005-05-12
## 6      2005 2005-12-31 2005-05-12   2005-04-28
## 7      2001 2001-12-31 2001-06-26   2001-06-12
## 8      2000 2000-12-31 2000-04-17   2000-04-03
## 9      1999 1999-12-31 1999-02-25   1999-02-11
## 10     1989 1989-12-31 1989-01-01   1988-12-18
## 11     2016 2016-12-31 2016-04-25   2016-04-11
## 12     2014 2014-12-31 2014-06-06   2014-05-23
## 13     2015 2015-12-31 2015-05-04   2015-04-20
## 14     2013 2013-12-31 2013-07-09   2013-06-25
## 15     2015 2015-12-31 2015-07-12   2015-06-28

Using the countyweather codes I can gather the data for each station in a loop. The code gathers the weather data for each stations and averages them. Then I saved all the data as rds. files because they take a long time to gather. The data is saved in a folder I created called “weather_files/”

for(i in which(has_stations))
{
    meteo_df <- meteo_pull_monitors(monitors = stations[[i]]$id,
                                 keep_flags = FALSE,
                                 date_min = outbreak_loc$date_min[i],
                                 date_max = outbreak_loc$date_max[i],
                                 var = c("prcp","snow","snwd","tmax","tmin","tavg"))

   coverage_df <- rnoaa::meteo_coverage(meteo_df, verbose = FALSE)
   filtered <- countyweather:::filter_coverage(coverage_df, 0.90)
   good_monitors <- unique(filtered$id)
   filtered_data <- dplyr::filter(meteo_df, id %in% good_monitors)
   averaged <- countyweather:::ave_weather(filtered_data)
   
   # For metrics that are reported in tenths of units (precipitation 
   # and temperature), divide by 10 to get values in degrees Celsius and
   # millimeters
   which_tenth_units <- which(colnames(averaged) %in% 
                                c("prcp", "tavg", "tmax", "tmin"))
   averaged[ , which_tenth_units] <- averaged[ , which_tenth_units] / 10
   
   file_name <- paste0("weather_files/", outbreak_loc$file_id[i], ".rds")
   saveRDS(averaged, file_name)
   #readRDS(file_name)
  }

Now that all of the data is gathered and averaged I can plot the data. The loop will go through the files in order which is in alphabetical order. Therefore I must order my outbreak data frame into alphabetical order too. I will rename this data frame as df_stations for plotting.

##              id      file_id latitude longitude year_min   date_min
## 1  bovenkarspel bovenkarspel    52.70      5.24     1989 1989-01-01
## 2         bronx        bronx    40.82    -73.92     2005 2005-01-01
## 3      columbus     columbus    39.98    -82.99     2003 2003-01-01
## 4      genesee1     genesee1    43.09    -83.63     2004 2004-01-01
## 5      genesee2     genesee2    43.09    -83.63     2005 2005-01-01
## 6        london       london    51.52     -0.10     1979 1979-01-01
## 7     melbourne    melbourne   -37.86    145.07     1990 1990-01-01
## 8      miyazaki     miyazaki    31.89    131.34     1992 1992-01-01
## 9        murcia       murcia    37.98     -1.12     1991 1991-01-01
## 10     pamplona     pamplona    42.81     -1.65     1996 1996-01-01
## 11   pittsburgh   pittsburgh    40.43    -79.98     2002 2002-01-01
## 12       quebec       quebec    46.85    -71.34     2002 2002-01-01
## 13   rapid city   rapid_city    44.06   -103.22     1995 1995-01-01
## 14    sarpsborg    sarpsborg    59.28     11.08     1995 1995-01-01
## 15       sydney       sydney   -33.85    150.93     2006 2006-01-01
##    year_max   date_max      onset before_onset
## 1      1999 1999-12-31 1999-02-25   1999-02-11
## 2      2015 2015-12-31 2015-07-12   2015-06-28
## 3      2013 2013-12-31 2013-07-09   2013-06-25
## 4      2014 2014-12-31 2014-06-06   2014-05-23
## 5      2015 2015-12-31 2015-05-04   2015-04-20
## 6      1989 1989-12-31 1989-01-01   1988-12-18
## 7      2000 2000-12-31 2000-04-17   2000-04-03
## 8      2002 2002-12-31 2002-07-18   2002-07-04
## 9      2001 2001-12-31 2001-06-26   2001-06-12
## 10     2006 2006-12-31 2006-06-01   2006-05-18
## 11     2012 2012-12-31 2012-08-26   2012-08-12
## 12     2012 2012-12-31 2012-07-18   2012-07-04
## 13     2005 2005-12-31 2005-05-26   2005-05-12
## 14     2005 2005-12-31 2005-05-12   2005-04-28
## 15     2016 2016-12-31 2016-04-25   2016-04-11

PLOT 1

Outbreak Distribution

This plot is divided by outbreaks in the northern and southern hemisphere. This allows us to see when the outbreaks generally occur in the year.

PLOT 2

10 years for all data

These plots allow for a quick glance into all the weather variables for each location.

## Warning: Removed 4 rows containing missing values (geom_path).

## Warning: Removed 19 rows containing missing values (geom_path).

## Warning: Removed 27 rows containing missing values (geom_path).

PLOT 3

TMAX and TMIN

## Warning: Removed 1098 rows containing missing values (geom_path).

## Warning: Removed 7 rows containing missing values (geom_path).

## Warning: Removed 3 rows containing missing values (geom_path).

## Warning: Removed 55 rows containing missing values (geom_path).

PLOT 4

Precipitation

I also made a loop to plot graphs and histograms of the data with lines indicating each day before the start of the outbreak for a total of 14 days.A plot of the percentiles is also included.

## Warning: Removed 946 rows containing non-finite values (stat_bin).
## Warning: Removed 4 rows containing missing values (geom_vline).

## Warning: Removed 24 rows containing missing values (geom_path).

## Warning: Removed 2690 rows containing non-finite values (stat_bin).
## Warning: Removed 1 rows containing missing values (geom_vline).

## Warning: Removed 27 rows containing missing values (geom_path).

## Warning: Removed 27 rows containing non-finite values (stat_bin).

PLOT 5

TMAX

## Warning: Removed 549 rows containing missing values (geom_path).

## Warning: Removed 549 rows containing non-finite values (stat_bin).

## Warning: Removed 3 rows containing missing values (geom_path).

## Warning: Removed 1038 rows containing non-finite values (stat_bin).
## Warning: Removed 8 rows containing missing values (geom_vline).

## Warning: Removed 8 rows containing missing values (position_stack).

## Warning: Removed 107 rows containing non-finite values (stat_bin).

## Warning: Removed 975 rows containing non-finite values (stat_bin).

## Warning: Removed 28 rows containing missing values (geom_path).

## Warning: Removed 28 rows containing non-finite values (stat_bin).

PLOT 6

TMIN

## Warning: Removed 549 rows containing missing values (geom_path).

## Warning: Removed 549 rows containing non-finite values (stat_bin).

## Warning: Removed 4 rows containing missing values (geom_path).

## Warning: Removed 1586 rows containing non-finite values (stat_bin).
## Warning: Removed 9 rows containing missing values (geom_vline).

## Warning: Removed 9 rows containing missing values (position_stack).

## Warning: Removed 3 rows containing missing values (geom_path).

## Warning: Removed 1594 rows containing non-finite values (stat_bin).
## Warning: Removed 5 rows containing missing values (geom_vline).

## Warning: Removed 5 rows containing missing values (position_stack).

## Warning: Removed 975 rows containing non-finite values (stat_bin).

## Warning: Removed 27 rows containing missing values (geom_path).

## Warning: Removed 27 rows containing non-finite values (stat_bin).